<template>
    <div class="content">
        <div v-if="data.length == 0" class="box">暂无数据</div>
        <div v-else>
            <div class="item" v-for="(item,index) in data" :key="index">
                <img v-if="item.avatar" src="@/assets/homeimg/ava.png" alt="">
                <img v-else :src="item.avatar" alt="">
                <div class="text">{{item.nickname}}</div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return {
            data:[]
        }
    },
    mounted() {
        var type = this.$route.query.type;
        this.loadData(type)
    },
    methods: {
        loadData(type){
            var url = ''
            if(type == 1){
                url = '/api/rate/one_user_list'
            }else{
                url = '/api/rate/two_user_list'
            }
            this.$http.post(url,{page:1,limit:10000}).then(res => {
                // console.log(res)
                this.data = res.data.data;
            })
        }
    },
}
</script>
<style lang="scss" scoped="scoped">
.box{
    text-align: center;
    margin-top: 20px;
}
.content{
    background-color: #F7F7F7;
    min-height: 100vh;
}
    .item{
        display: flex;
        justify-content: flex-start;
        align-items: center;
        width: 91vw;
        padding: 2.666vw;
        box-sizing: border-box;
        background-color: #fff;
        margin: 3vw auto 0;
        img{
            width: 10.06vw;
            width: 10.06vw;
        }
        .text{
            font-size:18px;
            font-family:PingFang SC;
            font-weight:500;
            color:rgba(51,51,51,1);
            margin-left: 2vw;
        }
    }
</style>